<div id="login" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="login-label"
        aria-hidden="true" onsubmit="return userLogin();">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                ×</button>
            <div id="login-label" class="juicy login-title">
                登&nbsp;&nbsp;录</div>
        </div>
        <div class="modal-body">
            <form action="index.php?act=customer.login" class="form-horizontal" id="user_login" method="post">
            <input type="text" name="user[email]" class="input-block-level" placeholder="注册邮箱">
            <input type="password" name="user[password]" class="input-block-level" placeholder="密码">
			<input type="text" name="verify" placeholder="验证码">
			<img style="cursor:pointer" title="刷新验证码" id="refresh" border='0' src='index.php?act=validatecode.generate_validate_code'   
onclick="document.getElementById('refresh').src='index.php?act=validatecode.generate_validate_code'"/> 
            <label class="checkbox">
                <input type="checkbox" name="remember_user" value="true">
                十天免登录
            </label>
            <span class="smoke">还没账号？<a href="register.php">现在注册！</a></span> <span class="carat grey">
                &nbsp;&nbsp;</span> <span>
                    <button class="btn btn-primary">
                        &nbsp;&nbsp;&nbsp;登&nbsp;录&nbsp;&nbsp;&nbsp;</button></span>
            </form>
            <label id="login-error-info" class="text-error hide">
            </label>
        </div>
    </div>
	
    <script>
        function userLogin() {

            $("#user_login").ajaxSubmit(function (message) {
                var obj = $.evalJSON(message);
                if (obj.success) {
                    location.reload();
                }
                else {
                    $("#login-error-info").text(obj.msg);
                    $("#login-error-info").removeClass("hide");
                }
            });

            return false;
        }
        function delCookie()//删除cookie
        {
            $.ajax({
                url: 'index.php?act=customer.logoff',
                type: 'GET',
                success: function (data) {
                    location.reload();
                }
            });
            return false;
        }
		$(document).on("click", ".dropdown-menu > li > a", function () {
			var searchType = $(this).data('id');
			$('#type-text').text(""+searchType);
			$('#search-text').attr("placeholder","搜索  "+searchType);
		});		
		$(document).on("click", ".navbar-content > .nav > li", function () {
			$(this).addClass("active");
			$(this).siblings().removeClass('active');
		});
		$(document).on("click", ".navbar-content > .nav > .dropdown > a ", function () {
			$(this).parent().siblings().removeClass('active');
		});
		function search()
		{
			var qtype="name";
			var querytype;
			querytype=$('#type-text').text();
			if(querytype=="书名")
			{
				qtype="name";
			}
			if(querytype=="作者")
			{
				qtype="author";
			}
			if(querytype=="出版社")
			{
				qtype="publisher";
			}
			$('#query_type').attr("value",qtype);
			//$('#query_type').val("name");
		}
	</script>